package com.gdzn.netty.api.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import javax.validation.constraints.Min;

/**
 * @description: netty服务配置信息
 * @author: cxz kenny
 * @created: 2021-10-15 14:50:25
 * @version: V1.0
 */
@Data
@Configuration
@ConfigurationProperties(prefix = "netty")
public class NettyProperties {
    /**
     * host
     */
    private String host;

    /**
     * port
     */
    private int port;

    /**
     * bossCount=1
     */
    @Min(1)
    private int boss_group;

    /**
     * workerCount
     */
    @Min(1)
    private int worker_count;

    /**
     * backlog
     */
    private int back_log;

    /**
     * MAX_RETRY
     */
    private int max_retry;


    /**
     * SO_KEEPALIVE=true/false
     */
    private Boolean so_keepalive;

    /**
     * TCP_NODELAY=true/false
     */
    private Boolean tcp_nodelay;

    /**
     * CONNECT_TIMEOUT_MILLIS=5000
     */
    private int connect_timeout_millis=5000;

    /**
     * web_sockert_port 端口
     */
    private int web_socket_port=9216;

    /**
     * 心跳读空闲时间
     */
    private int heart_read_time=600;
}
